package com.yhq.basic.jvm.classload.others;

import com.yhq.basic.jvm.classload.others.DestroyClassLoad;
import lombok.SneakyThrows;

/**
 * @author hqyin
 * @date 2023/3/1 6:31 下午
 */
public class TestMyClassLoad {
    @SneakyThrows
    public static void main(String[] args) {
//        MyClassLoad classLoad = new MyClassLoad("/Users/hqyin/Desktop");
//        Class clazz =  classLoad.loadClass("yhq.User");
//        clazz.newInstance();

        //测试打破双亲委派机制
        DestroyClassLoad destroyClassLoad = new DestroyClassLoad("/Users/hqyin/Desktop");
        Class clazz1 = destroyClassLoad.loadClass("yhq.User");
        clazz1.newInstance();
    }
}
